import cv2 as cv
import numpy as np

img = cv.imread('./../resources/miku.jpg')
gray = cv.imread('./../resources/miku.jpg', cv.IMREAD_COLOR) # 创建灰度图的第二种方式

print(img.shape) # H, W, C
print(gray.shape) # H, W

blank = np.zeros_like(img) # 创建空白图像
# np.zeros(img.shape, dtype=np.uint8) # 创建空白图像另一方法
# var = np.copy(img) # 深拷贝图片
blank[50:450, 50:450, :] = img[50:450, 50:450, :] # 图像局部拷贝

roi = img[50:450, 50:450, :] # 图像裁剪

cv.imshow('roi', roi)
cv.imshow('gray', gray)
cv.imshow('blank', blank)


cv.waitKey(0)
cv.destroyAllWindows()